if (!window.__IsIE__)
{
    window.__IsIE__ = window.navigator.userAgent.indexOf ("MSIE") > 0;
}

function FixPrototypeForGecko ()
{
    if (!__IsIE__)
    {
//        window.constructor.prototype.__defineGetter__ ("event", window_prototype_get_event);
        Event.prototype.__defineGetter__ ("srcElement", event_prototype_get_srcElement);
        Event.prototype.__defineSetter__ ('cancelBubble', event_prototype_set_cancel_bubble);
    }
}

function event_prototype_set_cancel_bubble (value)
{
    if (value) this.stopPropagation();
}

function element_prototype_get_runtimeStyle ()
{
    return this.style;
}
/*
function window_prototype_get_event ()
{
    return searchEvent ();
}
*/
function event_prototype_get_srcElement ()
{
    return this.target;
}

function searchEvent ()
{
/*
    //IE
    if (__IsIE__) return window.event;
    var func = SearchEvent.caller;
    while (func)
    {
        var arg0 = func.arguments[0];
        if (arg0 && arg0.constructor)
            if (arg0.constructor.toString ().indexOf ("Event") >= 0)
                return arg0;
        func = func.caller;
    }
    return null;
*/
    if (window.event) return event;
    return null;
}